<html>
    <head>
        <script language="JavaScript" type="text/javascript" src="ajax.js"></script>
        <link rel="stylesheet" type="text/css" href="tab.css" />
        <style type="text/css">
        table.border1px {
            border-collapse: collapse;
            border: 1px solid #000000;
            background-color: #CCCCCC;
        }
        table.border1px td {
            border: 1px solid #000000;
            padding: 3px;
        }
        </style>
    </head>
<body>
<?php
    include_once('datefunctions.php');
    include_once('functions_bandwidth_user.php');
?>
    <b>Detail <?php echo $_GET['client']; ?></b><br />
    &nbsp;<br />
    <table class="border1px">
        <tr>
            <td width="200" bgcolor="#CCCCCC"><font size='-1'><b>Domein</b></font></td>
            <td bgcolor="#CCCCCC"><font size='-1'><b>Gebruik</b></font></td>
        </tr>
<?php
    switch ($_GET['periode']){
        case 0:
            $Start = date("Y/m/d") . " 00:00:00";
            $Einde = date("Y/m/d") . " 23:59:59";
            break;
        case 1:
            $Start = date("Y/m/d") . " 00:00:00";
            $Start = DateAdd("d", -1, $Start);
            $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
            $Einde = date("Y/m/d") . " 23:59:59";
            $Einde = DateAdd("d", -1, $Einde);
            $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;
            break;
        case 2:
            $Einde = date("Y/m/d") . " 23:59:59";
            $Start = date("Y/m/d") . " 00:00:00";
            $Start = DateAdd("d", -6, $Start);
            $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
            break;
        case 3:
            $Start = date("Y/m/") . "1 00:00:00";
            $Einde = date("Y/m/") . "1 00:00:00";
            $Einde = DateAdd("m", 1, $Einde);
            $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;
            $Einde = DateAdd("d", -1, $Einde);
            $Einde = date("Y/m/d", $Einde) . ' 23:59:59';
            break;
        case 4:
            $Start = date("Y/m/") . "1 00:00:00";
            $Start = DateAdd("m", -1, $Start);
            $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
            $Einde = date("Y/m/") . "1 00:00:00";
            $Einde = DateAdd("d", -1, $Einde);
            $Einde = date("Y/m/d", $Einde) . ' 23:59:59';
            break;
    }

    $result = func_bw_volume_user_all_periode_detail($Start, $Einde,$_GET['client']);

    while ($row = mysql_fetch_array($result)){
        echo '<tr>';
        echo '<td style="background-color: #FFFFFF;"><font size="-1">' . $row['domein'] . '</font></td>';
        echo '<td style="background-color: #FFFFFF;" align="right"><font size="-1">' . round((($row['size'] /1024)/1024),1) . ' MB</font></td>';
        echo '</tr>';
    }
?>

    </table>
</body>
</html>